export {}

const schedule = require('./schedule');
const Config = require('../config');

const bot = require('../index');

async function onLogin(user: any) {
    console.log(`${user}登录了`)
    // 登陆后创建定时任务
    await onTask();
}
async function onTask() {
    
    schedule.setSchedule(Config.SENDDATE.TESTRULE, async () => {
        console.log('定时任务--');
        // const weiba = await bot.Contact.find({ alias: Config.ALIAS });
        // console.log(JSON.stringify(new Date()));
        // console.log(weiba);
        // await weiba.say(Config.WORDS);
        // console.log(JSON.stringify(bot.Contact));
    })
}

module.exports = onLogin;